﻿<Page
    x:Class="NicoApiHelper_CommentTest.NetFxCore.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:NicoApiHelper_CommentTest.NetFxCore"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" DataContext="{Binding Main, Mode=OneWay, Source={StaticResource Locator}}" Loaded="Page_Loaded">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="20"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="20"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="1" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TextBox x:Name="IDText" Grid.Column="1"/>
            <TextBlock Text="ID" Grid.Column="0"/>
            <Button x:Name="ConnectionButton" Content="接続" Grid.Column="2" Command="{Binding ConnectCommand, Mode=OneWay}"  CommandParameter="{Binding Text, ElementName=IDText}"/>
        </Grid>


        <ListView Grid.Row="2"  ItemsSource="{Binding ChatComments}">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <TextBlock Text="{Binding UserId, Mode=OneWay}"/>
                        <TextBlock Text="{Binding Body, Mode=OneWay}"/>
                    </StackPanel>
                </DataTemplate>
                
            </ListView.ItemTemplate>

        </ListView>


        <Grid Grid.Row="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TextBox x:Name="SendMessageText" Grid.Column="0" />
            <Button Grid.Column="1" Content="送信" Command="{Binding SendMessageCommand, Mode=OneWay}" CommandParameter="{Binding Text, ElementName=SendMessageText}"  />
        </Grid>
    </Grid>
</Page>
